<script type='text/javascript' src="{webroot:public/javascript/cart.js}"></script>
<section class="breadcrumb">
	<span>{echo:ILang::get('您当前的位置')}：</span> <a href="{url:}">{echo:ILang::get('首页')}</a> » {echo:ILang::get('购物车')}
</section>
<section class="web">
	<div id="cart_prompt" class="cart_prompts none">
		<strong>{echo:ILang::get('恭喜，您的订单已经满足了以下优惠活动')}！</strong>
		<ol id="cart_prompt_box"></ol>
	</div>
	<!--促销规则模板-->
	<script type="text/html" id="promotionTemplate">
		<li><%=item['plan']%>，<%=item['info']%></li>
	</script>

	<section class="cart_table">
		<h3><i class="fa fa-shopping-cart"></i>{echo:ILang::get('查看购物车')}</h3>
		<table>
			<colgroup>
				<col width="30px">
				<col width="115px">
				<col>
				<col width="120px">
				<col width="120px">
				<col width="120px">
				<col width="116px">
				<col width="120px">
				<col width="120px">
			</colgroup>
			<thead>
				<tr><th><input type="checkbox" name="_selectCartGoods" onchange="selectAll('selectCartGoods');" /></th><th>{echo:ILang::get('图片')}</th><th>{echo:ILang::get('商品名称')}</th><th>{echo:ILang::get('赠送积分')}</th><th>{echo:ILang::get('单价')}</th><th>{echo:ILang::get('优惠')}</th><th>{echo:ILang::get('数量')}</th><th>{echo:ILang::get('小计')}</th><th>{echo:ILang::get('操作')}</th></tr>
			</thead>
			<tbody>
				{foreach:items = $this->goodsList key=$goodsKey}
				<script>var item{$goodsKey} = {echo:JSON::encode($item)};</script>
				<tr>
					<td><input type="checkbox" name="selectCartGoods[{$item['seller_id']}][]" value="{$item['goods_id']}_{$item['product_id']}" /></td>
					<td><img src="{url:/pic/thumb/img/$item['img']/w/66/h/66}" alt="{$item['name']}"></td>
					<td>
						<a href="{url:/site/products/id/$item['goods_id']}" class="blue">{$item['name']}</a>
						{if:isset($item['spec_array'])}
						<p>
						{set:$spec_array=goods_class::show_spec($item['spec_array']);}
						{foreach:items=$spec_array item=$specValue key=$specName}
							{$specName}：{$specValue} &nbsp&nbsp
						{/foreach}
						</p>
						{/if}
					</td>
					<td>{$item['point']}</td>
					<td><em>￥{$item['sell_price']}</em></td>
					<td>{echo:ILang::get('优惠')} ￥{$item['reduce']}</td>
					<td>
						<div class="goods_resize">
							<span class="reduce" onclick='cart_reduce(item{$goodsKey});'>─</span>
							<input class="input" type="text" onchange='cartCount(item{$goodsKey});' id="count_{$item['goods_id']}_{$item['product_id']}" value="{$item['count']}" maxlength="5" />
							<span class="add" onclick='cart_increase(item{$goodsKey});'>+</span>
						</div>
					</td>
					<td><em>￥<span id="sum_{$item['goods_id']}_{$item['product_id']}">{$item['sum']}</span></em></td>
					<td><a href="javascript:void(0);" onclick='removeCartByJSON(item{$goodsKey})'>{echo:ILang::get('删除')}</a></td>
				</tr>
				{/foreach}

				<tr>
					<td colspan="9" class="stats">
						<span>{echo:ILang::get('商品总重量')}：<b id='weight'>{$this->weight}</b></span><br>
						<span>{echo:ILang::get('商品总金额')}：￥<b id='origin_price'>{$this->sum}</b> - {echo:ILang::get('商品优惠')}：￥<b id='discount_price'>{$this->reduce}</b> - {echo:ILang::get('促销活动优惠')}：￥<b id='promotion_price'>{$this->proReduce}</b></span><br>
						{echo:ILang::get('金额总计（不含运费）')}：￥<em id='sum_price'>{$this->final_sum}</em>
					</td>
				</tr>
			</tbody>
		</table>
		<div class="cart_btn">
			<div class="clear_cart_btn" onclick="delModel({msg:'{echo:ILang::get('确定要清空购物车么')}？',link:'{url:/simple/clearCart}'});">
				<i class="fa fa-remove"></i>
				<span>{echo:ILang::get('清空购物车')}</span>
			</div>
			<div class="go_back_btn" onclick="window.history.go(-1);">
				<i class="fa fa-reply"></i>
				<span>{echo:ILang::get('继续购物')}</span>
			</div>
			{if:$this->goodsList}
			<a class="gopay_btn" href="{url:/simple/cart2}">
				<i class="fa fa-credit-card"></i>
				<span>{echo:ILang::get('去结算')}</span>
			</a>
			{/if}
		</div>
	</section>
</section>